<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>For a Fair Go | Go Gecko</title>
        <meta name="robots" content="noindex,nofollow" />
        <meta name="viewport" content="width=320, user-scalable=no" />
        <meta http-equiv="description" content="Capped commissions ... you deserve it. Browse our offices, latest listings, sales, and find information for listing your property." />
        <meta http-equiv="keywords" content="" />
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta http-equiv="cache-control" content="no-cache" />
        <meta http-equiv="pragma" content="no-cache" />
        <meta http-equiv="expires" content="-1" />

        <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>css/mobile.css" />
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>css/khiem_mobile.css" />
        <link type="text/css" href="<?php echo base_url(); ?>css/menu.css" rel="stylesheet" />
        <link type="text/css" href="<?php echo base_url(); ?>css/jquery-ui-1.9.0.custom.min.css" rel="stylesheet" />

        <?php if (isset($cssLinks)) echo $cssLinks; ?>

        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.8.2.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-ui-1.9.0.custom.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/superfish.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/supersubs.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/suckerfish.js"></script>

        <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBD6K693C64UOIUryWW6sRepij-C7Sn3D8&sensor=false"></script>

        <script>
            $(document).ready(function() {
                showCompMsgs();
                $("ul.sf-menu").supersubs({
                    minWidth: 9.6, // minimum width of sub-menus in em units
                    maxWidth: 9.6, // maximum width of sub-menus in em units
                    extraWidth: 1                                  // extra width can ensure lines don't sometimes turn over
                            // due to slight rounding differences and font-family
                }).superfish({
                    delay: 400, // delay on mouseout
                    animation: {opacity: 'show', height: 'show'}, // fade-in and slide-down animation
                    speed: 'fast', // faster animation speed
                    autoArrows: false, // disable generation of arrow mark-up
                    dropShadows: false                              // disable drop shadows
                });

            });

            function removeCompMsgs() {
                $("[id^=cmsg]").each(function() {
                    var target = $(this).attr("id").substring(4);
                    $("[id$=" + target + "]").not("[id^=cmsg]").removeAttr("class", "error");
                    var msg = $(this).val();
                    $("[id=" + target + "]").next('img.error').remove();
                    var icon = document.createElement("img");
                    $(icon).addClass("mandatory");
                    $(icon).attr("src", "<?php echo base_url(); ?>img/sev/required.jpg");
                    $(icon).attr("title", 'This is a required value');
                    $("[id$=" + target + "]").not("[id^=cmsg]").after(icon);

                });
                $("[id^=cmsg]").remove();
            }

            function showCompMsgs() {
                $("[id^=cmsg]").each(function() {
                    var target = $(this).attr("id").substring(4); /* everything after 'cmsg' */
                    $("[id$=" + target + "]").not("[id^=cmsg]").removeAttr("class", "error");
                    var msg = $(this).val();
                    $("[id=" + target + "]").next('img.mandatory').remove();
                    $("[id$=" + target + "]").not("[id^=cmsg]").addClass("error");

                });
                if ($('img.mandatory').length == 0) {
                    $(".mandatory").not("img.mandatory").each(function() {
                        var nextEl = $(this).next();
                        if (!$(nextEl).hasClass("error")) {
                            var icon = document.createElement("img");
                            $(icon).addClass("mandatory");
                            $(icon).attr("src", "<?php echo base_url(); ?>img/sev/required.jpg");
                            $(icon).attr("title", "This is a required value");
                            $(this).after(icon);
                        }
                    });
                }
            }
        </script>
        <script type="text/javascript">
            //        $(function(){
            //            setAutoComplete("search", "results", "<?php echo site_url('home/ajax_search?part=') ?>");
            //        });


            function autocomplate(id, hidden_id) {
                $("#" + id).autocomplete({
                    delay: 100,
                    source: function(request, response) {
                        $.ajax({
                            url: "<?php echo site_url('home/ajax_search?part=') ?>" + request.term,
                            dataType: 'json',
                            success: function(json) {
                                response($.map(json, function(item) {
                                    return item
                                }));
                                return false
                            }
                        });
                    },
                    select: function(event, ui) {
                        $("#" + hidden_id).val(ui.item.values);
                    },
                    focus: function(event, ui) {
                        return false;
                    }
                });
            }
            $(document).ready(function() {
                $("#search").autocomplete({
                    delay: 100,
                    source: function(request, response) {
                        $.ajax({
                            url: "<?php echo site_url('home/ajax_search?part=') ?>" + request.term,
                            dataType: 'json',
                            success: function(json) {
                                response($.map(json, function(item, key) {
                                    return {
                                        label: item,
                                        values: key
                                    }
                                }));
                                return false
                            }
                        });
                    },
                    select: function(event, ui) {
                        $("#keyword").val(ui.item.values);
                    },
                    focus: function(event, ui) {
                        return false;
                    }
                });

                $('#search-form').submit(function() {

                    var keyword = $('#keyword').val();
                    if (keyword != '')
                        window.location.href = '<?php echo site_url('offices/find') ?>/' + keyword;
                    else
                        window.location.href = '<?php echo site_url('offices/find') ?>';
                    return false;
                })
            });
        </script>
    </head>
    <body class="page">
        <!-- Page -->
        <div id="page" class="hfeed">
            <!-- Header section -->
            <?php
            if (isset($fielderrors)) {
                foreach (array_keys($fielderrors) as $fieldid) {
                    echo '<input type="hidden" id="cmsg' . $fieldid . '" value="' . $fielderrors[$fieldid] . '"/>';
                }
            }
            ?>
            <!-- Header section -->
            <header id="header" role="banner">

                <!-- Logo -->
                <a id="logo" class="wrapper" href="<?php echo site_url('home/index'); ?>">

                </a>


                <!-- Navigation -->
                <div id="navigation">
                    <ul class="wrapper">
                        <li><?php echo anchor('buying/listings', 'Buy'); ?></li>
                        <li><?php echo anchor('tenant/rentals', 'Rent'); ?></li>
                        <li><?php echo anchor('contactus', 'Contact'); ?></li>
                    </ul>
                </div>

            </header> 

            <?php echo $body; ?>



            <!-- Footer -->
            <div id="footer" class="footer">

                <!-- Navigation -->
                <div id="footer-navigation">
                    <div class="wrapper">
                        <h2>Site Navigation</h2>
                        <ul class="links">
                            <li><?php echo anchor('home', 'Home'); ?></li>
                            <li><?php echo anchor('tenant/rentals', 'Rent'); ?></li>
                            <li><?php echo anchor('contactus', 'Contact'); ?></li>
                        </ul>
                        <ul class="view-full">
                            <li><?php echo anchor('buying/listings', 'Buy'); ?></li>
                            <li><?php echo anchor('selling/gogecko', 'Sell'); ?></li>
                            <li><?php echo anchor('home/?mobile=off', 'View Full Go Gecko Site'); ?>
                                <span>(not optimised for mobile)</span>
                            </li>

                        </ul>
                    </div>
                </div>

                <!-- Colophon -->
                <footer id="colophon" role="contentinfo">
                    <div class="wrapper">
                        <div id="copyright">
                            <span class="line">Copyright 2013 Go Gecko</span>
                        </div>
                    </div>
                </footer>

            </div>

        </div>

    </body>
</html>